<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>voice</title>
</head>
<body>
<link rel="stylesheet" href="./res/rongcloud.css">
<a href="https://github.com/rongcloud/websdk-demo/blob/master/voice.html" class="get-source">获取源码</a>


<h1>声音库</h1>
<h2><a href="http://www.rongcloud.cn/docs/web.html#声音库">http://www.rongcloud.cn/docs/web.html#声音库</a></h2>

<script src="//cdn.ronghub.com/Libamr-2.2.5.min.js"></script>
<script src="//cdn.ronghub.com/RongIMVoice-2.2.5.min.js"></script>

<!-- 引入base64编码的arm音频数据 -->
<script src="./res/voice-amr-base64.json"></script>

<script>
var RongIMVoice = RongIMLib.RongIMVoice;
	RongIMVoice.init();

function play(){
	// 音频持续大概时间(秒)
	var duration = voice.length/1024;
    RongIMVoice.preLoaded(voice);
    RongIMVoice.play(voice,duration);
}
</script>


<button onclick="play()">播放base64</button>
</body>
</html>